<template>
  <div>
<!--    <div class="table-page-search-wrapper">-->
<!--      <a-form-model-->
<!--        layout="inline"-->
<!--        :model="queryParam"-->
<!--      >-->
<!--        <a-row :gutter="15">-->
<!--          <a-col :md="6" :sm="24">-->
<!--            <a-form-model-item label="商标名称">-->
<!--              <a-input v-model="queryParam['filter[phone]']"/>-->
<!--            </a-form-model-item>-->
<!--          </a-col>-->
<!--          <a-col :md="6" :sm="24">-->
<!--            <a-form-model-item label="商标状态">-->
<!--              <a-input v-model="queryParam['filter[b_name]']"/>-->
<!--            </a-form-model-item>-->
<!--          </a-col>-->
<!--          <template v-if="advanced">-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-item label="入库时间">-->
<!--                <a-range-picker @change="onTime1" />-->
<!--              </a-form-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-item label="领取时间">-->
<!--                <a-range-picker @change="onTime2" />-->
<!--              </a-form-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-model-item label="业务分类">-->
<!--                <a-select v-model="queryParam['filter[first_type]']" :default-value="0">-->
<!--                  <a-select-option v-for="(item,index) in firstTypeOpts" :key="index" :value="index">-->
<!--                    {{item}}-->
<!--                  </a-select-option>-->
<!--                </a-select>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-model-item label="搜索引擎">-->
<!--                <a-input v-model="queryParam['filter[search_engine]']"/>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-model-item label="首次页面">-->
<!--                <a-input v-model="queryParam['filter[first_url]']"/>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-model-item label="领取状态">-->
<!--                <a-select v-model="queryParam['filter[receive_status]']" :default-value="0">-->
<!--                  <a-select-option v-for="(item,index) in receiveStatusOpts" :key="index" :value="index">-->
<!--                    {{item}}-->
<!--                  </a-select-option>-->
<!--                </a-select>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-model-item label="按搜索词">-->
<!--                <a-input v-model="queryParam['filter[search_keywords]']"/>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-model-item label="领取顾问">-->
<!--                <a-input v-model="queryParam['filter[receiver_info]']"/>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-item label="搜索的IP">-->
<!--                <a-input v-model="queryParam['filter[ip]']"/>-->
<!--              </a-form-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-model-item label="放弃状态">-->
<!--                <a-select v-model="queryParam['filter[is_abandon]']" :default-value="0">-->
<!--                  <a-select-option v-for="(item,index) in abandonStatusOpts" :key="index" :value="index">-->
<!--                    {{item}}-->
<!--                  </a-select-option>-->
<!--                </a-select>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :md="6" :sm="24">-->
<!--              <a-form-model-item label="客户状态">-->
<!--                <a-select v-model="queryParam['filter[customer_status]']" :default-value="0">-->
<!--                  <a-select-option v-for="(item,index) in customerStatusOpts" :key="index" :value="index">-->
<!--                    {{item}}-->
<!--                  </a-select-option>-->
<!--                </a-select>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--          </template>-->
<!--          <a-col :md="!advanced && 8 || 24" :sm="24">-->
<!--                <span class='table-page-search-submitButtons' :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">-->
<!--                  <a-button type="primary" @click="$refs.table.refresh(true)">搜索</a-button>-->
<!--                  <a-button style="margin-left: 8px" @click="resetForm">重置</a-button>-->
<!--                  <a @click="toggleAdvanced" style="margin-left: 8px">-->
<!--                    {{ advanced ? '收起' : '展开' }}-->
<!--                    <a-icon :type="advanced ? 'up' : 'down'" />-->
<!--                  </a>-->
<!--                </span>-->
<!--          </a-col>-->
<!--        </a-row>-->
<!--      </a-form-model>-->
<!--    </div>-->
    <div class="table-operator">
      <s-table
        bordered
        ref="table"
        :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        :row-key="(record) => record.id"
        :columns="checkColumns"
        :data="checkData"
      >
        <div
          slot="filterDropdown"
          slot-scope="{ setSelectedKeys, selectedKeys, confirm, clearFilters, column }"
          style="padding: 8px"
        >
          <a-input
            v-ant-ref="c => (searchInput = c)"
            :placeholder="`筛选${column.title}`"
            :value="selectedKeys[0]"
            style="width: 188px; margin-bottom: 8px; display: block;"
            @change="e => setSelectedKeys(e.target.value ? [e.target.value] : [])"
          />
          <a-button
            type="primary"
            icon="search"
            size="small"
            style="width: 90px; margin-right: 8px"
            @click="() => handleSearch(selectedKeys, confirm, column.dataIndex)"
          >
            筛选
          </a-button>
          <a-button size="small" style="width: 90px" @click="() => handleReset(clearFilters)">
            重置
          </a-button>
        </div>
        <template slot="title">
          <a-button size="small" type="primary">批量通过</a-button>
          <a-button size="small" type="danger" style="margin-left:5px">批量放弃</a-button>
        </template>
        <template slot="xu" slot-scope="text,record,index">{{ index + 1 }}</template>
        <template slot="category" slot-scope="text">
          {{ categoryOpts[text] }}
        </template>
        <template slot="action">
          <a-button size="small" type="primary" style="margin-right:5px" @click="accept">通过</a-button>
          <a-button size="small" type="danger" @click="refund">放弃</a-button>
        </template>
      </s-table>
    </div>
  </div>
</template>

<script>
import { STable } from '@/components'
import otherColumns from '@/columns/other'

export default {
  components: {
    STable
  },
  props: {
    isType: {
      type: String,
      default: ''
    }
  },
  name: 'UnCheck',
  data () {
    return {
      checkColumns: otherColumns.list,
      checkData: parameters => {
        return new Promise(resolve => {
          resolve({
            data: [
              {
                'id': 6,
                'tm_name': '天猫',
                'adviser_name': '程婉',
                'notes': '阿达水电费',
                'status': 0,
                'category': '3',
                'check_name': '',
                'created_at': '2021-08-23 09:57:14'
              }
            ]
          })
        })
      },
      categoryOpts: {
        '1': '1化工原料',
        '2': '2油漆染料',
        '3': '3日化用品',
        '4': '4油脂染料',
        '5': '5医用药物',
        '6': '6金属材料',
        '7': '7机械机器',
        '8': '8手工用具',
        '9': '9电子产品',
        '10': '10医疗器械',
        '11': '11厨卫设备',
        '12': '12交通工具',
        '13': '13爆炸物品',
        '14': '14珠宝首饰',
        '15': '15乐器',
        '16': '16办公用品',
        '17': '17塑料橡胶',
        '18': '18皮革制品',
        '19': '19非金属建材',
        '20': '20家具',
        '21': '21厨具卫具',
        '22': '22纺织原料',
        '23': '23纱线',
        '24': '24床上用品',
        '25': '25服装鞋帽',
        '26': '26服饰绣品',
        '27': '27地毯席类',
        '28': '28娱乐玩具',
        '29': '29加工食品',
        '30': '30方便食品',
        '31': '31未加工食品',
        '32': '32啤酒饮料',
        '33': '33酒类',
        '34': '34烟及烟类',
        '35': '35广告销售',
        '36': '36金融房产',
        '37': '37建筑装饰',
        '38': '38通讯服务',
        '39': '39物流旅游',
        '40': '40加工服务',
        '41': '41教育培训',
        '42': '42科技研发',
        '43': '43餐饮酒店',
        '44': '44医疗保健',
        '45': '45提供人员'
      },
      searchInput: null,
      searchText: '',
      searchedColumn: '',
      queryParam: {},
      selectedRowKeys: []
    }
  },
  created () {
    this.queryParam['filter[status]'] = 0
  },
  methods: {
    onSelectChange (selectedRowKeys) {
      this.selectedRowKeys = selectedRowKeys
    },
    accept () {
      this.$confirm({
        title: '是否确认通过此商标'
      })
    },
    refund () {
      this.$confirm({
        title: '是否放弃此商标'
      })
    }
  }
}
</script>

<style scoped>

</style>
